<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title><s:if test="#session.sessionUsername==null">
				idea地图娱乐
			</s:if> <s:else>
                ideamaps地图娱乐,${sessionUsername}
			</s:else></title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		 <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAsnD6g25AONVvr5_uQnxNMhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxR2cLQuGnOrK47JDGlIBIlcD_w_jA"></script>
		 
		<script type="text/javascript">
          google.load("maps", "2");
                                   
          function initialize() {
            var map = new google.maps.Map2(document.getElementById("map_canvas"));
            var center = new google.maps.LatLng(${30.86443655},${120.0992775});
            map.setCenter(center, 14);
            map.openInfoWindow(map.getCenter(),document.createTextNode("Hi, 欢迎来到ideamaps"));
            map.addControl(new GLargeMapControl());
            map.addControl(new GMapTypeControl());
            var currentMaker = new GMarker(center, {draggable: true});
            map.addOverlay(currentMaker);
            GEvent.addListener(currentMaker, "click", function() {
               var myHtml = "fuck,叫你乱点！" ;
               map.openInfoWindowHtml(currentMaker.getPoint(), myHtml);
            });

          }
          google.setOnLoadCallback(initialize);
        </script>

		<script type="text/javascript">
			function ddd(){
				if(document.getElementById("username").value==''){
					alert('Username is requried');
					return false;
				}
		            return true;
			}
			
			function checkUserName(ssn){
			if(ssn.length<3 || ssn.length>8){
			document.getElementById("usernameErr").innerHTML="<font color='red'>请输入正确的用户名，用户名长度为3-8位！</font>";
			form.username.focus()
			return false;
			}
			document.getElementById("usernameErr").innerHTML="";
			}
			
		</script>

	</head>

	<body>

		<h2>
			Login
		</h2>
		<s:form action="login" namespace="/">
			<s:textfield name="username" label="Username" />
			<s:password name="password" label="Password" />
			<s:submit value="Submit Login"></s:submit>
		</s:form>

		<h2>
			Register
		</h2>
		<s:form action="register" namespace="/">
			<s:textfield name="user.username" label="Username" id="username"
				onblur="checkUserName(this.value.toLowerCase())" />
			<span id="usernameErr"></span>

			<s:password name="user.password" label="Password" />
			<s:password name="confirmPassword" label="Confirm Password" />

			<s:textfield name="user.email" label="Email" />
			<s:submit value="Submit Register"></s:submit>
		</s:form>

		<div style="width: 300px; float: right;">
			<s:form theme="simple">
				<!-- BEGIN geoiptool.com -->
				<script language="JavaScript"
					src="http://www.geoiptool.com/webjs.php?xl=en&xt=1&xw=200&xh=275"></script>
				<noscript>
					<a target="_blank" href="http://www.geoiptool.com/">Geo Web
						Tool</a>
				</noscript>
				<!-- END geoiptool.com -->
			</s:form>
		</div>

		<div id="map_canvas" style="width:600px; height: 400px; border: 1px solid red;"></div>

	</body>
</html>
